<?php
namespace Tbf\Bundle\CronBundle\Tests;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Tbf\Bundle\CronBundle\DependencyInjection\TbfCronExtension;

class TbfCronExtensionTest extends CronBundleTestCase
{
    public function testLoad()
    {
        $extension = new TbfCronExtension();
        $container = new ContainerBuilder();
        $extension->load(array(),$container);
        $container->setDefinition('logger',new Definition('Tbf\Bundle\TestBundle\Logger\ArrayLogger'));
        $container->setDefinition('tbf.clock',new Definition('Tbf\Component\DateTime\Clock\SystemClock'));
        $container->compile();
        $this->assertTrue($container->hasDefinition('tbf_cron'));
        $this->assertTrue($container->hasDefinition('tbf_cron.repository'));
    }
}
